package entity

type MasterCmdConfig struct {
	Task string `yaml:"task"`
}

func (r *MasterCmdConfig) AllEmpty() bool {
	return r.Task == ""
}

func (r *MasterCmdConfig) Compare(obj FieldInterface) FieldInterface {
	localConfig, ok := obj.(*MasterCmdConfig)
	if !ok || localConfig == nil || localConfig.AllEmpty() {
		return r
	}

	if localConfig.Task == "" {
		localConfig.Task = r.Task
	}

	return localConfig
}
